package org.example.lysh.db.router.dynamic;

import org.example.lysh.db.router.DBContextHolder;
import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource;

/**
 * @author liyishan
 * @date 2023/7/11 18:37
 * @apiNote
 */

public class DynamicDataSource extends AbstractRoutingDataSource {

    @Override
    protected Object determineCurrentLookupKey() {
        return "db"+ DBContextHolder.getDBKey();
    }

}
